﻿#ifndef IMAGETEXTEXPORTER_H
#define IMAGETEXTEXPORTER_H

#include "QtGui/qtextobject.h"

class ImageTextExporter
{
public:
    ImageTextExporter(const QTextDocument *_doc);

    QString toHtml();

private:
    void emitFrame(QTextFrame::Iterator frameIt);
    void emitTextFrame(const QTextFrame *frame);
    void emitBlock(const QTextBlock &block);
    void emitTable(const QTextTable *table);
    void emitFragment(const QTextFragment &fragment);

    bool emitCharFormatStyle(const QTextCharFormat &format);
    void emitFloatStyle(QTextFrameFormat::Position pos);
    void emitAttribute(const char *attribute, const QString &value);

    void emitFontFamily(const QString &family);

    QString html;
    QTextCharFormat defaultCharFormat;
    const QTextDocument *doc;
};


#endif // IMAGETEXTEXPORTER_H
